<?=view('admin.common.header')?>
<table class="table">
    <tr>
        <td>装维姓名:</td>
        <td><?=$instperson->name?></td>
    </tr>
    <tr>
        <td>联系电话:</td>
        <td><?=$instperson->phone?></td>
    </tr>
    <tr>
        <td colspan="2">
            <?php foreach ($plots as $val): ?>
            <label>
                <input type="checkbox" name="plots[]" <?php if (in_array($val->id, $iplotsarr)): ?>checked="checked" <?php endif; ?>  value="<?=$val->id?>"> <kbd><?=$val->name?></kbd>　
            </label>
            <?php endforeach; ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            <a href="#" class="btn btn-success eveChange" onclick="return false;">修改管理小区</a>
        </td>
    </tr>
</table>
<script>
    $('.eveChange').click(function(){
        if($(this).attr('disabled') == 'disabled')
            return false;
        $(this).attr('disabled', 'disabled');
        var plots = "";
        $('input[type=checkbox]:checked').each(function(){
            plots += $(this).val()+',';
        });
        if (plots.length > 1)
            plots = plots.slice(0, plots.length-1);
        $.post(window.location.href, {plots:plots}, function(data) {
            layer.msg(data.info);
            if (data.status == 1) {
                window.parent.location.reload();
            }
        });
        return false;
    });
</script>
<?=view('admin.common.footer')?>